package net.lovesrc.allin.jobs;

import net.lovesrc.allin.biz.idcard.IdCardService;
import net.lovesrc.allin.jobs.base.BaseJob;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.io.IOException;
import java.util.concurrent.atomic.AtomicBoolean;

@Component
//@Profile("live")
public class IdCardOcrJob extends BaseJob {

    public AtomicBoolean flag = new AtomicBoolean(true) ;

    @Autowired
    private IdCardService idCardService;

    @Override
    public void runOnce() throws IOException {
        idCardService.ocr();
    }

    @Override
    protected long intervalMilliseconds() {
        return 3 * 1000;
    }


    @Override
    public boolean runFlag() {
        return flag.get();
    }
}
